package com.wnxy.gym.gateway.config;


import com.wnxy.gym.common.jwt.JwtTemplate;
import com.wnxy.gym.gateway.properties.JwtTemplateProperties;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(value = JwtTemplateProperties.class)
public class JwtTemplateConfig {
    @Autowired
    JwtTemplateProperties jwtTemplateProperties;

    @Bean
    public JwtTemplate getJwtTemplate() {
        return new JwtTemplate(jwtTemplateProperties.getPath(),
                jwtTemplateProperties.getKeyStoreSecurity(),
                jwtTemplateProperties.getKeySecurity(),
                jwtTemplateProperties.getAlias());
    }

}
